<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>五子棋对战平台</title>
    <!-- Bootstrap CSS -->
    <link href="./css/bootstrap.min.css" rel="stylesheet">
    
</head>
<body class="bg-light">
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="#">五子棋</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link active" href="#" id="home-link">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#" id="records-link">对战记录</a>
                    </li>
                </ul>
                <div class="d-flex align-items-center">
                    <div class="dropdown">
                        <button class="btn btn-outline-light dropdown-toggle" type="button" id="userDropdown" data-bs-toggle="dropdown">
                            <span id="usernameDisplay">用户名</span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-end">
                            <li><a class="dropdown-item" href="#" id="profileLink">个人资料</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="#" id="logoutLink">退出登录</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </nav>

    <!-- 主内容区 -->
    <div class="container my-5" id="main-content">
        <!-- 首页内容 -->
        <div id="home-view">
            <div class="text-center mb-5">
                <h1 class="display-4">五子棋对战平台</h1>
                <p class="lead">选择您的对战方式</p>
            </div>
            
            <div class="row g-4">
                <!-- 人机对战 -->
                <div class="col-md-4">
                    <div class="card game-option-card h-100" id="ai-mode">
                        <div class="card-body text-center">
                            <div class="mb-3">
                                <i class="bi bi-robot fs-1"></i>
                            </div>
                            <h3 class="card-title">人机对战</h3>
                            <p class="card-text">挑战不同难度的AI对手</p>
                            <button class="btn btn-primary mt-3" id="start-ai-btn">开始游戏</button>
                        </div>
                    </div>
                </div>
                
                <!-- 本地双人 -->
                <div class="col-md-4">
                    <div class="card game-option-card h-100" id="local-mode">
                        <div class="card-body text-center">
                            <div class="mb-3">
                                <i class="bi bi-people-fill fs-1"></i>
                            </div>
                            <h3 class="card-title">本地双人</h3>
                            <p class="card-text">同一设备上轮流操作</p>
                            <button class="btn btn-success mt-3" id="start-local-btn">开始游戏</button>
                        </div>
                    </div>
                </div>
                
                <!-- 联机对战 -->
                <div class="col-md-4">
                    <div class="card game-option-card h-100" id="online-mode">
                        <div class="card-body text-center">
                            <div class="mb-3">
                                <i class="bi bi-globe fs-1"></i>
                            </div>
                            <h3 class="card-title">联机对战</h3>
                            <p class="card-text">与在线玩家对战</p>
                            <button class="btn btn-info mt-3" id="start-online-btn">开始游戏</button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 观战入口 -->
            <div class="mt-5 text-center">
                <button class="btn btn-outline-secondary" id="watch-btn">
                    <i class="bi bi-eye"></i> 进入观战模式
                </button>
            </div>
        </div>
        
        <!-- 对战记录视图 -->
        <div id="records-view" class="d-none">
            <div class="d-flex justify-content-between align-items-center mb-4">
                <h2 class="mb-0">对战记录</h2>
                <button class="btn btn-sm btn-outline-danger" id="clear-records">清空记录</button>
            </div>
            <div class="table-responsive">
                <table class="table table-hover" id="records-table">
                    <thead class="table-light">
                        <tr>
                            <th>对战类型</th>
                            <th>结果</th>
                            <th>对手</th>
                            <th>日期</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <!-- 记录将通过JS动态生成 -->
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <!-- 游戏模式选择模态框 -->
    <div class="modal fade" id="gameModeModal" tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="modeModalTitle">选择游戏选项</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                </div>
                <div class="modal-body">
                    <!-- 动态内容将根据点击的按钮注入 -->
                    <div id="ai-options" class="d-none">
                        <div class="mb-3">
                            <label class="form-label">选择AI难度</label>
                            <select class="form-select" id="ai-level">
                                <option value="easy">简单</option>
                                <option value="medium" selected>中等</option>
                                <option value="hard">困难</option>
                            </select>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">选择棋子颜色</label>
                            <select class="form-select" id="ai-color">
                                <option value="black">黑棋(先手)</option>
                                <option value="white">白棋(后手)</option>
                                <option value="random">随机</option>
                            </select>
                        </div>
                    </div>
                    
                    <div id="local-options" class="d-none">
                        <div class="alert alert-info">
                            <i class="bi bi-info-circle"></i> 本地双人模式将在同一设备上轮流操作
                        </div>
                        <div class="mb-3">
                            <label class="form-label">棋盘大小</label>
                            <select class="form-select" id="board-size">
                                <option value="15">15×15 (标准)</option>
                                <option value="19">19×19 (专业)</option>
                            </select>
                        </div>
                    </div>
                    
                    <div id="online-options" class="d-none">
                        <div class="mb-3">
                            <label class="form-label">选择房间</label>
                            <div class="input-group">
                                <input type="text" class="form-control" id="room-id" placeholder="输入房间号">
                                <button class="btn btn-outline-secondary" type="button" id="random-room">随机</button>
                            </div>
                        </div>
                        <div class="alert alert-warning">
                            <i class="bi bi-exclamation-triangle"></i> 注意：这是模拟联机功能
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" id="confirm-start">开始游戏</button>
                </div>
            </div>
        </div>
    </div>

    <!-- Bootstrap Icons -->
    <link rel="stylesheet" href="#">
    
    <!-- Bootstrap JS 和依赖 -->
    <script src="./js/bootstrap/bootstrap.bundle.min.js"></script>
    
    <!-- 应用主逻辑 -->
    <script src="./js/app.js"></script>
</body>
</html>